package com.cbh.feign.controller.institution;


import java.util.List;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.cbh.api.model.ApiResult;
import com.cbh.api.model.institution.Team;
import com.cbh.api.model.institution.TeamMember;


public interface TeamControllerBase {

	@RequestMapping(value = "/auth/v3/team", method = RequestMethod.POST, produces = "application/json")
	public ApiResult<String> save(
			 @RequestParam(value = "accountToken", required = true) String accountToken,
			@RequestBody(required = true) Team ob);

	/**
	 * 根据ID获取团队信息
	 * 
	 * @param id
	 * @return
	 */
	@RequestMapping(value = "/auth/v3/team/id", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<Team> getByIcId(
			@RequestParam(value = "accountToken", required = true) String accountToken,
			@RequestParam(value = "id", required = true) String id);

	/**
	 * 获取团队信息
	 * 
	 * @return
	 */
	@RequestMapping(value = "/auth/v3/team", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<List<Team>> getAll(
			@RequestParam(value = "accountToken", required = true) String accountToken);

	/**
	 * 团队成员添加
	 * 
	 * @param accountToken
	 * @param team_id
	 * @param user_id
	 * @return
	 */
	@RequestMapping(value = "/auth/v3/team/member", method = RequestMethod.POST, produces = "application/json")
	public ApiResult<Boolean> saveMember(@RequestParam(value = "accountToken", required = true) String accountToken,
			@RequestParam(value = "team_id", required = true) String team_id,
			@RequestParam(value = "id", required = true) String id);

	/**
	 * 团队成员移除
	 * 
	 * @param accountToken
	 * @param id
	 * @return
	 */
	@RequestMapping(value = "/auth/v3/team/member", method = RequestMethod.DELETE, produces = "application/json")
	public ApiResult<Boolean> remove(@RequestParam(value = "accountToken", required = true) String accountToken,
			@RequestParam(value = "id", required = true) String id);

	/**
	 * 团队成员列表
	 * 
	 * @param accountToken
	 * @param id
	 * @return
	 */
	@RequestMapping(value = "/auth/v3/team/memberlist", method = RequestMethod.GET, produces = "application/json")
	public ApiResult<List<TeamMember>> list(@RequestParam(value = "accountToken", required = true) String accountToken,
			@RequestParam(value = "id", required = true) String id);

}
